<template>
    <div id="moblie-main" >
        <router-view></router-view>
    </div>
</template>
<script>

import { stopBackSpace } from '@/util/ieStopBack'
export default {
  // name: 'App'
  components: {},
  beforeCreate() {

  },
  mounted() {
    this.$nextTick(() => {
      console.info($('body').height());
      $('#moblie-main').height($('body').height());
    });
  },
  created() {
    document.getElementById('app-main').style.display='none';
    window.$ready = false;
    document.onkeypress = stopBackSpace;
    document.onkeydown = stopBackSpace;
    if (sessionStorage.getItem('store')) {
      this.$store.replaceState(
        Object.assign(
          {},
          this.$store.state,
          JSON.parse(sessionStorage.getItem('store'))
        )
      );
    }
    window.addEventListener('beforeunload', () => {
      this.$store.state.home.params = null;
      sessionStorage.setItem('store', JSON.stringify(this.$store.state));
    });
    var docEl = document.documentElement,
      resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
      recalc = function() {
        // var clientWidth = docEl.clientWidth;
        // if (!clientWidth) return;
        // docEl.style.fontSize = 100 * (clientWidth / 1080) + 'px';
        // if (docEl.style.fontSize.replace(/px/, '') > 100) docEl.style.fontSize = '100px';
      };
    if (!document.addEventListener) return;
    window.addEventListener(resizeEvt, recalc, false);
    document.addEventListener('DOMContentLoaded', recalc, false);
  }
};
</script>
<style>
    #moblie-main {
        height: 100%;
        width: 100%;
    }
</style>
